Parasitoids of the Cotesia flavipes complex (C. flavipes and Cotesia sesamiae) are natural enemies of stemboring lepidopteran pests in sub-Saharan Africa. The two species are difficult to differentiate using morphological markers, and a quick, reliable test was sought for their correct identification. After numerous, unsuccessful attempts at developing species-specific monoclonal antibodies that could differentiate between the two species, we were successful in using near-infrared spectroscopy to distinguish the cocoons of the two species with an accuracy of better than 85%. Calibrations were established using partial least squares analysis, enabling identification of cocoons of known species, cocoons from an alternative host, as well as in blind tests. This technology would greatly expedite identification of field-caught insects used to determine ecological parameters and parasitization rates of an individual species.